
/***************************************************************************
*
* Title          : Arduino based sACN (E1.31) -> LED Pixel, Digital LED Strip gateway for WS2801
* Version        : v 0.4 beta
* Last updated   : 21.08.2013
* Target         : Arduino Mega 2560
* Author         : David Stone - david <at> uberatomic <dot> com
*
*
***************************************************************************
 This program is free software; you can redistribute it and/or 
 modify it under the terms of the GNU General Public License 
 as published by the Free Software Foundation; either version 2 of 
 the License, or (at your option) any later version. 

 This program is distributed in the hope that it will be useful, 
 but WITHOUT ANY WARRANTY; without even the implied warranty of 
 MERCHANTABILITY or FITNESS FOR A PsacnICULAR PURPOSE. See the GNU 
 General Public License for more details. 

 If you have no copy of the GNU General Public License, write to the 
 Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 

 For other license models, please contact the author.

;***************************************************************************/

#define SOURCE_NAME_ADDR 44

#define ACN_IDENTIFIER_SIZE 12



#define ACN_IDENTIFIER "ASC-E1.17\0\0\0"

//The well-known streaming ACN port (currently the ACN port)
#define STREAM_IP_PORT 5568

#define short_get_high_byte(x)((HIGH_BYTE & x) >> 8)
#define short_get_low_byte(x)(LOW_BYTE & x)
#define bytes_to_short(h,l)( ((h << 8) & 0xff00) | (l & 0x00FF) );

struct sacn_node_s {
  
  //Root Layer
  uint16_t preamble;
  uint16_t postamble;
  uint8_t  packetId		[12];
  uint16_t flagsLength;
  uint8_t  vector		[4];
  uint8_t  CID			[16];
  //Framing Layer
  uint16_t frmFlagsLength;
  uint8_t  frmVector	[4];
  uint8_t  sourceName	[64];
  uint8_t  priority;
  uint8_t  reservedIgnore	[2];
  uint8_t  seqNo;
  uint8_t  options;
  uint8_t  universeNo      [2];
  //DMP Layer
  uint16_t dmpFlagsLength;
  uint8_t  dmpVector;
  uint8_t  addrType;
  uint16_t firstPropertyAddr;
  uint16_t addrIncrement;
  uint16_t propValCount;
  uint8_t  dataValues	[513];
  
} __attribute__((packed));

typedef struct sacn_node_s sacn_node_t;


